package com.molin.threadTest.threadTools.countDownLatchTest;

import com.molin.OOP.TestExtends.test1.C;

import java.util.concurrent.CountDownLatch;

public class Demo {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch =new CountDownLatch(3);
        MotherThread motherThread=new MotherThread(countDownLatch);
        ChildThread1 childThread1=new ChildThread1(countDownLatch);
        ChildThread2 childThread2=new ChildThread2(countDownLatch);
        ChildThread3 childThread3=new ChildThread3(countDownLatch);

        childThread1.setName("小明");
        childThread2.setName("小红");
        childThread3.setName("小刚");

        motherThread.start();
        childThread1.start();
        childThread2.start();
        childThread3.start();

        Thread.sleep(500);
        System.out.println("爸爸在玩游戏...");
    }
}
